package com.lagou.plugin;

import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Invocation;

import java.util.Properties;

/**
 * @param
 * @author oyz
 * @version 1.0.4
 * @description: 自定义拦截器
 * @date 2022/10/24 22:19
 */
public class MyPlugin implements Interceptor {

    /**
     * 拦截方法，只要被拦截的对象执行目标方法的时候，就会执行该方法
     * @param invocation
     * @return
     * @throws Throwable
     */
    @Override
    public Object intercept(Invocation invocation) throws Throwable {
        return null;
    }

    /**
     * 主要是为了把当前的拦截器生成代理存到拦截器链中
     * @param target
     * @return
     */
    @Override
    public Object plugin(Object target) {
        return Interceptor.super.plugin(target);
    }

    @Override
    public void setProperties(Properties properties) {
        Interceptor.super.setProperties(properties);
    }
}
